package com.example.verifysdk;

import com.example.verifysdk.auth.GoogleAuthenticator;
import com.example.verifysdk.auth.GoogleAuthenticatorConfig;

import java.util.concurrent.TimeUnit;

/**
 * Created by Administrator on 2017/5/8.
 */

public class AuthUtil {
    private static GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder gAcb = new GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder().setTimeStepSizeInMillis(TimeUnit.SECONDS.toMillis(60)).setWindowSize(3).setCodeDigits(6);
    private static GoogleAuthenticator gAuth = new GoogleAuthenticator(gAcb.build());

    public static int getTotp(String sec){
        return gAuth.getTotpPassword(sec);
    }
}
